﻿namespace PhotobucketNet
{
    using System;
    using System.Xml;

    public class UserUrls
    {
        private string _album;
        private string _api;
        private string _feed;
        private string _image;
        private string _path;

        private UserUrls()
        {
        }

        internal static UserUrls CreateFromXmlResponseMessage(XmlResponseMessage responseMessage)
        {
            UserUrls urls = new UserUrls();
            XmlNode node = responseMessage.ResponseXml.SelectSingleNode("descendant::subdomain");
            XmlNode node2 = node.SelectSingleNode("descendant::album");
            urls._album = node2.InnerText;
            XmlNode node3 = node.SelectSingleNode("descendant::image");
            urls._image = node3.InnerText;
            XmlNode node4 = node.SelectSingleNode("descendant::api");
            urls._api = node4.InnerText;
            XmlNode node5 = node.SelectSingleNode("descendant::feed");
            urls._feed = node5.InnerText;
            XmlNode node6 = responseMessage.ResponseXml.SelectSingleNode("descendant::path");
            urls._path = node6.InnerText;
            return urls;
        }

        public string Album
        {
            get
            {
                return this._album;
            }
        }

        public string Api
        {
            get
            {
                return this._api;
            }
        }

        public string Feed
        {
            get
            {
                return this._feed;
            }
        }

        public string Image
        {
            get
            {
                return this._image;
            }
        }

        public string Path
        {
            get
            {
                return this._path;
            }
        }
    }
}

